//
//  YQResponse.h
//  yiqiquan
//
//  Created by lx on 16/7/14.
//  Copyright © 2016年 honhot. All rights reserved.
//  返回值

#import <Foundation/Foundation.h>

extern NSString * const YQResponseCodeTokenInvalidNote;
typedef enum{
    YQResponseCodeTokenInvalid = -1,  //token失效
    YQResponseCodeError = 0,        //错误
    YQResponseCodeSuccess = 1,      //成功
}YQResponseCode;

@interface YQResponse<__covariant ObjectType> : NSObject

//返回的code  0错误  1成功
@property(nonatomic, assign) NSInteger error_code; 
//返回的信息
@property(nonatomic, copy) NSString *msg;
//总条数
@property(nonatomic, assign) NSInteger total_num;
//总页数
@property(nonatomic, assign) NSInteger total_page;
//是否有下一页
@property(nonatomic, assign) BOOL next;
//是否有上一页
@property(nonatomic, assign) BOOL prev;
//列表数据
@property(nonatomic, strong) NSArray<ObjectType> *dataList;
//对象数据
@property(nonatomic, strong) ObjectType attr;

//实现一个错误的返回
+ (instancetype)errorResponseWithMsg:(NSString *)msg;

@end
